/*
 * TSPCostMatrix.h
 *
 *  Created on: Jan 23, 2011
 *      Author: santiago
 */

#ifndef TSPCOSTMATRIX_H_
#define TSPCOSTMATRIX_H_

#include <vector>

using namespace std;

class TSPCostMatrix {
public:
	TSPCostMatrix();
	TSPCostMatrix(const TSPCostMatrix &original);
	TSPCostMatrix(unsigned int node_count);
	virtual ~TSPCostMatrix();

	double get_cost(unsigned int node_index_1, unsigned int node_index_2) const;
	void set_cost(unsigned int node_index_1, unsigned int node_index_2, double cost);

	unsigned int get_node_count() const;
	void show() const;

	TSPCostMatrix& operator=(const TSPCostMatrix &original);
private:
	void convert_to_matrix(unsigned int node_index_1, unsigned int node_index_2,
			unsigned int &first_node_index, unsigned int &second_node_index) const;

	vector<vector<double> > _costs;
	unsigned int _node_count;
};

#endif /* TSPCOSTMATRIX_H_ */
